<?php

namespace App\Lib\_Validator\Rules;


use Hyperf\Validation\Validator;

/**
 * 手机验证码验证
 * Class CodeRule
 * @package App\Lib\_Validator\Rules
 */
class CodeRule implements RuleInterface
{
    const NAME = 'code';


    /**
     * @param $attribute
     * @param $value
     * @param $parameters
     * @param Validator $validator
     * @return bool
     */
    public function passes($attribute, $value, $parameters, Validator $validator): bool
    {
        return $value === '123456';
    }

    /**
     *
     * @param $message
     * @param $attribute
     * @param $rule
     * @param $parameters
     * @param Validator $validator
     * @return string
     */
    public function message($message, $attribute, $rule, $parameters, Validator $validator): string
    {
        return $message;
    }
}